set more off

cd C:\Users\urdinez\Dropbox\JING\RESUBMISSION\B&P

***MAIN TABLE***

   *COUNTRY
use country_level, clear
 
xtset ccode year
xtpoisson num  c.log_unga_imp log_chinese_immigrants log_gdp  log_dist_china  log_exchrate  log_agnu_china  exports  log_natres i.year if  year<2011 , re

  estimates store country
     
	 
   *FIRM
	use firm_level, clear  
reg log_capitalinvested i.equity2##c.log_unga_imp   log_totalfixedassets age  log_exchrate log_chinese_immigrants log_agnu_china log_gdp  log_dist_china  exports log_profit log_natres i.year, vce(r)

estimates store firm

     
   
   *DYADIC
   use dyadic_level, clear
  logit invest i.equity2##c.log_unga_imp   log_totalfixedassets age log_chinese_immigrants  log_exchrate  log_agnu_china log_gdp  log_dist_china exports log_profit log_natres  i.year
estimates store dyadh2
	
esttab  country firm dyadh2 , ar2 pr2 

*******************************************************

**ROBUSTNESS CHECK**

*SASAC  


  *FIRM
 use firm_level, clear 
  reg log_capitalinvested i.sasac##c.log_unga_imp   log_totalfixedassets age  log_exchrate log_chinese_immigrants log_agnu_china log_gdp  log_dist_china  exports log_profit log_natres i.year
  
   *DYADIC
   use dyadic_level, clear
  logit invest i.sasac##c.log_unga_imp log_chinese_immigrants  log_totalfixedassets age   log_exchrate  log_agnu_china log_gdp  log_dist_china log_exports log_profit log_natres  i.year, vce(r)
estimates store sasac2
	
esttab   sasac2 , ar2 pr2 


*Taiwan FDI
use country_level, clear
xtset ccode year
gen log_taiwan_fdi=taiwan_fdi
replace log_taiwan_fdi=1 if log_taiwan_fdi==0
replace log_taiwan_fdi=ln(log_taiwan_fdi)
 tobit log_taiwan_fdi  c.log_unga_imp log_gdp   log_exchrate log_chinese_immigrants log_agnu_china  log_dist_china exports  log_natres i.year, ll(0)
 estimates store taiwan
  esttab taiwan

*Russian UNGA
use country_level, clear
 
xtset ccode year
xtpoisson num  c.log_russia_unga log_chinese_immigrants log_gdp  log_dist_china  log_exchrate  log_agnu_china  exports  log_natres i.year if  year<2011 , re


use firm_level, clear  
reg log_capitalinvested i.equity2##c.log_russia_unga   log_totalfixedassets age  log_exchrate log_chinese_immigrants log_agnu_china log_gdp  log_dist_china  exports log_profit log_natres i.year, vce(r)


use dyadic_level, clear
logit invest i.equity2##c.log_russia_unga log_chinese_immigrants  log_agnu_china  log_dist_china log_totalfixedassets log_gdp age  log_exchrate log_profit   exports log_natres i.year 


use firm_level, clear  
reg log_capitalinvested i.sasac##c.log_russia_unga   log_totalfixedassets age  log_exchrate log_chinese_immigrants log_agnu_china log_gdp  log_dist_china  exports log_profit log_natres i.year


use dyadic_level, clear
logit invest i.sasac##c.log_russia_unga log_chinese_immigrants  log_agnu_china  log_dist_china log_totalfixedassets log_gdp age  log_exchrate log_profit   exports log_natres i.year 

   
